import {componentCategoryArray, componentGroupArray, componentTypeArray} from "../common";
import {tableOptBtnConfig} from "../table";

export default {
  "tableId": "component",
  "name": "组件",
  "columns": [
    {
      label: '组件名称',
      width: 200,
      children: [
        {
          key: 'name',
          tooltip: true
        },
      ]
    },
    {
      label: '组件类型',
      width: 120,
      children: [
        {
          key: 'typeText'
        },
      ]
    },
    {
      label: '组件功能',
      width: 120,
      children: [
        {
          key: 'categoryText'
        },
      ]
    },
    // {
    //   label: '小组件设备类别',
    //   width: 120,
    //   children: [
    //     {
    //       key: 'deviceTypeText'
    //     },
    //   ]
    // },
    {
      label: '组件状态',
      width: 120,
      children: [
        {
          key: 'status'
        },
      ]
    },
    {
      label: '组件分组',
      width: 120,
      children: [
        {
          key: 'groupText'
        },
      ]
    },
    // {
    //   label: '标签',
    //   width: 150,
    //   children: [
    //     {
    //       key: 'category'
    //     },
    //   ]
    // },
    {
      label: '预览图',
      "width": 150,
      children: [
        {
          image: true,
          key: 'previewImages'
        },
      ]
    },
    {
      label: '备注',
      width: 150,
      children: [
        {
          key: 'remarks'
        },
      ]
    },
    {
      label: '更新时间',
      width: 100,
      children: [
        {
          updatedDate: true
        }
      ],
    },
    {
      "label": "操作",
      "operation": true,
      "width": 250,
      "children": [
        {
          "button": true,
          type: tableOptBtnConfig.select.type,
        },
        {
          "button": true,
          type: tableOptBtnConfig.preview.type,
        },
        {
          "button": true,
          type: tableOptBtnConfig.edit.type,
        },
        {
          'dropdown': true,
          'options': [
            {
              'type': tableOptBtnConfig.copy.type
            },
            {
              'type': tableOptBtnConfig.delete.type,
              'class': 'hover-font-danger'
            },
            {
              'type': tableOptBtnConfig.audit.type,
              'showKey': 'showAuditBtn',
            },
            {
              'type': tableOptBtnConfig.deleteAudit.type,
              'showKey': 'deleteAuditBtn',
            },
            {
              'type': tableOptBtnConfig.release.type,
              'showKey': 'releaseBtn',
            },
            {
              'type': tableOptBtnConfig.deleteRelease.type,
              'showKey': 'deleteReleaseBtn',
            },
            {
              'type': tableOptBtnConfig.group.type,
              'showKey': 'groupEditBtn'
            },
            {
              'type': tableOptBtnConfig.export.type,
              label: '导出组件配置',
            },
            {
              'type': tableOptBtnConfig.exportZip.type,
              label: '导出组件资源包',
            },
          ]
        }
      ]
    }
  ],
  "filters": [
    {
      "fieldType": "input",
      key: 'name',
      label: '组件名称'
    },
    {
      "fieldType": "input",
      key: 'version',
      label: '版本号'
    },
    {
      "fieldType": "input",
      key: 'createdByName',
      label: '创建人'
    },
    {
      "fieldType": "string",
      key: 'type',
      label: '组件类型',
      "options": componentTypeArray
    },
    {
      "fieldType": "string",
      key: 'category',
      label: '组件功能',
      "dataApi": API.deviceType.deviceTypeAll,
    },

    {
      "fieldType": "string",
      key: 'group',
      label: '组件分组',
      "options": componentGroupArray
    },
  ]
}
